package cn.beforedark.yygh.hosp.controller.user;


import cn.beforedark.yygh.common.result.R;
import cn.beforedark.yygh.hosp.service.DepartmentService;
import cn.beforedark.yygh.vo.hosp.DepartmentVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * /user/hosp/department
 */
@RestController
@RequestMapping("/user/hosp/department")
public class UserDepartmentController {

    @Autowired
    private DepartmentService departmentService;

    /**
     * hoscode 查所有科室
     *
     * @param hoscode hoscode
     * @return vo
     */
    @GetMapping("/all")
    public R findAll(String hoscode) {
        List<DepartmentVo> departmentList = departmentService.getDepartmentList(hoscode);
        return R.ok().data("list", departmentList);
    }

}
